package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.domain.vo.DishVo;
import com.itheima.service.DishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/dish")
public class DishControllerClient {

    @Autowired
    private DishService dishService;

    @GetMapping("/list")
    public R<List<DishVo>> categoryList(@RequestParam(value = "categoryId" ,required = false) String categoryId, @RequestParam(value = "status",required = false) String status ){
        log.info("分类集合 categoryId={} status={} ",categoryId,status);
        return dishService.clientCategoryList(categoryId, status);
    }
}
